/**
 *
 * @returns {object} 返回当前url的? 参数对象
 */
function getQuery() {
  var search = window.location.search.substring(1);
  var params = {};

  if (search) {
    var paramPairs = search.split("&");

    for (var i = 0; i < paramPairs.length; i++) {
      var pair = paramPairs[i].split("=");

      if (pair.length === 2) {
        var key = decodeURIComponent(pair[0]);
        var value = decodeURIComponent(pair[1]);

        params[key] = value;
      }
    }
  }

  return params;
}
